package streamAPI;

import java.util.ArrayList;
import java.util.List;

public class demo {
	public static void main(String[] args) {
		List<String> list=new ArrayList<>();
		list.add("1");
		list.add("2");
		list.add("3");
		list.add("4");
		System.out.println(list.stream().filter(l->l.equals("1")).count());
		System.out.println(list.parallelStream().filter(l->l.equals("1")).count());//并行执行

	}
}
